<template>
  <view class="childForm">
    <uni-section :title="items.content" v-for="(items, index) in item" :key="index" type="circle">
      <view class="childForm-item" v-for="(list, indexs) in lists" :key="indexs">
        <span>{{ list.name }}</span>
        <span v-if="!list.type">{{ items.reportRecord[list.value] || '--' }}</span>
        <span v-else-if="list.type == 'name'">{{ name }}</span>
        <view v-else-if="list.type == 'radio'" style="height: 38rpx; line-height: 38rpx;">
          <view v-if="items.reportRecord[list.value]">
            <radio style="transform:scale(0.5)" :disabled="items.reportRecord[list.value] == 1 ? true : false"
              :checked="items.reportRecord[list.value] == 0 ? true : false" />符合
            <radio style="transform:scale(0.5)" :disabled="items.reportRecord[list.value] == 0 ? true : false"
              :checked="items.reportRecord[list.value] == 1 ? true : false" />不符合
          </view>
          <view v-else>--</view>
        </view>
      </view>
    </uni-section>
  </view>
</template>

<script>
export default {
  name: 'childForm',
  props: {
    item: {
      type: Array,
      default: () => []
    },
    name: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      lists: [
        {
          name: '维保项目',
          value: 'name',
          type: 'name'
        },
        {
          name: '位置/编码',
          value: 'location'
        },
        {
          name: '测试结果',
          value: 'content'
        },
        {
          name: '判 定',
          value: 'judgment',
          type: 'radio'
        },
        {
          name: '发现的问题及处理措施',
          value: 'problemAction'
        },
      ]
    }
  },
  created() {
    console.log(this.item)
  },
  methods: {
  }
}
</script>
<style lang="scss" scoped>
.childForm {
  padding: 0 10px 5px;

  &-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
</style>